<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile
/** @var \Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Form $block */
?>
<?php $code = $block->escapeHtml($block->getMethodCode()) ?>
<fieldset class="form-list" id="payment_form_<?php /* @noEscape */ echo $code; ?>" style="display:none;">
    <div class="admin__field _required">
        <label for="<?php /* @noEscape */ echo $code; ?>_ba_agreement_id" class="admin__field-label">
            <span><?php echo $block->escapeHtml(__('Billing Agreement')); ?></span>
        </label>
        <div class="admin__field-control">
            <select id="<?php /* @noEscape */ echo $code; ?>_ba_agreement_id"
                    name="payment[<?php echo $block->escapeHtml($block->getTransportBAId()); ?>]"
                    class="required-entry admin__control-select">
                <option value=""><?php echo $block->escapeHtml(__('Please Select')); ?></option>
                <?php foreach ($block->getBillingAgreements() as $id => $referenceId): ?>
                    <option value="<?php echo $block->escapeHtml($id); ?>">
                        <?php echo $block->escapeHtml($referenceId); ?>
                    </option>
                <?php endforeach; ?>
            </select>
        </div>
    </div>
</fieldset>
